package edu.upol.paradise.compiler.types;

import org.apache.log4j.Logger;

public class ParadiseFloat extends ParadiseNumber {
	static final Logger log = Logger.getLogger(ParadiseFloat.class);
	
	private double value = 0;
	
	public ParadiseFloat(double value){
		this.setValue(value);
	}

	public double getValue() {
		return value;
	}

	public ParadiseFloat setValue(double value) {
		this.value = value;
		return this;
	}
	
	public String toString(){
		return ""+value;
	}
	
	public boolean valueEquals(ParadiseObject other) {
		if (other instanceof ParadiseFloat && ((ParadiseFloat)other).value == value)
			return true;
		return false;
	}
	
	public int atomHashId() {
		return new Float(value).hashCode();
	}

	@Override
	protected double floatValue() {
		return value;
	}
}
